home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 11 / Mac Magazin and MacEasy Magazine CD - Issue 11.iso / Sharewarebibliothek / Spiele / Tic Tac Toe ƒ / tictactoe.readme < prev   
Text File  |  1994-06-10  |  7KB  |  194 lines

  1. This is the updated documentation for the Tic Tac Toe Game written by Joel
  2. Weight
  3.  
  4. This game was written as a final project for Russell Baird's Computer
  5. Science 112 class at Snow College, Ephraim Utah.  It was written during
  6. pretty much all of Spring quarter, 1994.  It was finally compiled on June
  7. 6.  I hope you all enjoy it.
  8.  
  9. In case you were wondering, the original documentation exists only in hard
  10. copy, and solely for the purpose of a grade.  Most of this documentation is
  11. for that same purpose, but if any of it helps any of you, then yippeee I
  12. will feel like it was all worth while.
  13.  
  14.  
  15. INSTALLATION
  16.    This is much easier now.  You don't have to get into Think Pascal to
  17. start the game.  In order to get into the game, all you must do is double
  18. click on the Application titled Tic Tac Toe 1.1.  This will bring up a
  19. window with the Tic Tac Toe board drawn in it, and you can immediately
  20. start playing.
  21.  
  22. HOW TO USE THE PROGRAM
  23.    There are a few changes here too.  First, the window is no longer modal.
  24. It is movable and resizable.  In order to resize it, just grab it by the
  25. bottom right, like you would any other window, and drag it to the size that
  26. you want.  Placing an X or an O is the same.  Simply click in the square
  27. that you want the X or O to be in.  The cursor will resemble the piece that
  28. will be placed.
  29.    There have been some changes to the the menu.  Now, there are only three
  30. choices in the file menu.  New, Close, and Quit.  Every option is
  31. functional and has default behavior.  In the Edit menu, the only option
  32. that will be enabled that applies to Tic Tac Toe is the Clear option.  This
  33. will clear all of the X's and O's in the current Tic Tac Toe window, and
  34. allow you to play again on the same board rather than having to get a new
  35. window as in the last version.
  36.  
  37. ******************************************
  38. TECHNICAL DOCUMENTATION
  39.    This is the the text about the code that I wrote.  If you just going to
  40. play this game for fun, then you don't have to read this.
  41.  
  42.  
  43.  
  44. ***CTICTACTOEWINDOW***
  45.  
  46. Heritage
  47.    Superclass : CWindow
  48.    Subclass : none
  49.  
  50. Using CTICTACTOEWINDOW
  51.    This was written so that I could have some instance variables of my
  52. gamepanes in an array that resembled the board.  In order to use it, you
  53. must have the CGamePane type, and the CSquarePane type so that the window
  54. can create those panes.
  55.  
  56. Variables
  57.    itsGamePane : CGamePane
  58. this variable is a pane that fills the entire window, and encloses all of
  59. the SquarePanes.
  60.    itsSquarePanes : Array [(left, middle, right), (top, center, bottom)] of
  61. CSquarePane
  62. This is an array of the squarepanes that are the boxes that the X's and O's
  63. go in.  They are arranged 3 by 3 in itsGamePane.
  64.  
  65. Methods
  66.  
  67. Procedure ITicTacToeWindow (WINDid: integer; asupervisor : CDirector);
  68.    initializes a tictactoewindow.  In this method, the createpanes method
  69. is called.
  70. it calls the inherited IWindow method which sets up a window with the
  71. WINDid window id,  not floating, an enclosure which is the global variable
  72. gdesktop, and a supervisor that was passed to the method.
  73.  
  74. Procedure CreatePanes;
  75.    This method does just that, it creates the panes, those being
  76. itsGamePane, and all of the panes in the itsSquarePanes array.  It places
  77. them on the screen in the initial configuration too.
  78.  
  79. Procedure ChangeSize (width, height : integer);
  80.    This method had to be overridden so that it would place all of
  81. itsSquarePanes in the correct place when the window was resized.  It
  82. accounts for the width of the lines, so that the panes don't overlap those,
  83. and then it accounts for the other panes, so that they don't overlap each
  84. other.
  85.  
  86. Procedure clear;
  87.    This method sends a clearpane method to all of itsSquarePanes.
  88.  
  89.  
  90.  
  91. ***CGGAMEPANE***
  92.  
  93. Heritage
  94.    superclass : CPane
  95.    subclass : none
  96.  
  97. Using CGamePane
  98.    This is a descendant of CPane that has variables to keep track of the
  99. current piece so that the Tic Tac Toe game can draw the correct one.  I
  100. don't know that you will ever want to use this.
  101.  
  102. Variables
  103.  
  104. thepiece : char;
  105.    this represents the piece that is currently being played, either X or O.
  106.  
  107. thecurrentcursor : integer;
  108.    this is the cursor that corresponds to the piece.  It refers to the ID
  109. of either the X cursor or the O cursor, that is why it is of type integer.
  110.  
  111.  
  112. Methods
  113.  
  114. Procedure IGamePane (anEnclosure:CView; aSupervisor:CBureaucrat);
  115.    Initializes a game pane and fits it to the enclosure.  The game pane is
  116. elastic both vertically and horizontally.  This sets thepiece variable to
  117. 'X' and thecurrentcurso to the XcursorID
  118.  
  119. Procedure Draw (Var area : rect);
  120.    Draws the lines of a traditional tic tac toe board, to the limits of the
  121. gamepane.  You shouldn't need to call this, because it is automatically
  122. called with a refresh, and it will figure where to put the lines when the
  123. window is resized.
  124.  
  125. Function currentpiece : char;
  126.    Returns thepiece.
  127.  
  128. Procedure changepiece;
  129.    thepiece variable is changed from X to O or from O to X, and calls
  130. changecursor.
  131.  
  132. Procedure changecursor;
  133.    Calls setcursor to set the cursor to match thepiece.
  134.  
  135.  
  136. ***CSQUAREPANE***
  137.  
  138. Using CSQUAREPANE
  139.    In order to use this, you must have the Ctictactoewindow, and the
  140. cgamepane.  It relies on those in several of the methods.  The Csquarepane
  141. and the cgamepane are very dependant on each other, in that the csquarepane
  142. accesses some of cgamepane's variables so that it can know what to do.
  143.  
  144. variables
  145.  
  146. itsfull : boolean;
  147.    this is true if the mouse has been clicked within the pane.
  148. itspiece : char;
  149.    this tells which piece was drawn in the pane, if any.  it is either an X
  150. or an O
  151. itsgamepane : cgamepane;
  152.    this is so that you can get to the methods of the gamepane that the
  153. squarepane is in.
  154.  
  155. methods
  156.  
  157. Procedure ISquarePane (anEnclosure : CView; aSupervisor : CBureaucrat;
  158. aHEncl, aVEncl : integer; thegamepane : cgamepane);
  159.    this calls the inherited IPane.   The enclosure is anEnclosure, the
  160. Supervisor is aSupervisor, awidth is 90, aheight is 90, ahencl and avencl
  161. are ahencl and avencl respectively, and it is elastic both vertically and
  162. horizontally.  ISquarePane sets itsfull to false, itspiece to ' ' and tells
  163. it that it wants clicks.
  164.  
  165. Function full : boolean;
  166.    this returns the contents of the itsfull variable
  167.  
  168. Procedure DoClick (hitPt : point; modifierKeys : integer; when : longint);
  169.    if the pane is not full, then it will set itspiece to
  170. itsgamepane.currentpiece, then it puts the picture corresponding to
  171. itspiece in the pane, changes the piece, changes teh cursor, and sets
  172. itsfull to true.  None of the variables are really used in my method.
  173.  
  174. Procedure Draw (Var area: rect);
  175.    Draws an X, an O, or nothing, depending on what itspiece is.
  176.  
  177. Procedure ClearPane;
  178.    Sets all of the variables back to what they were when they were
  179. initialized, those being itsfull := false, itspiece := ' ', and then it
  180. calls a refresh so that the draw method will get rid of any X's or O's.
  181.  
  182. Procedure adjustcursor (where : point; mousergn : rgnhandle);
  183.    calls changecursor so that the cursor resembles the piece, (X or O),
  184. unless the pane is full, then it has default behavior in that the cursor is
  185. an arrow.
  186.  
  187. Procedure resizeframe (delta:rect);
  188.    Resizes the frame only approximately one third of what it would normally
  189. so that the panes don't overlap each other, or the lines.
  190.  
  191. ***THE END***
  192.  
  193.  
  194.